<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<style>
    .navbar-inverse .navbar-brand{
        color: #FFF;
    }
    .navbar-inverse .navbar-nav > .active > a{
        color : rgba(255, 255, 255, 0.7);
        background-color: rgba(0,0,0,-0.8);
    }
    .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus{
        background-color: rgba(0,0,0,-0.8);
    }
    .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand {
        margin-left: 3px;
    }
    .navbar-right {
        float: right !important;
        margin-right: 0px;
    }
    .navbar-fixed-top, .navbar-fixed-bottom {
         position: static;
    }
    .wrap > .container {
        padding-top: 0;
    }

    /*nav {*/
        /*width: 62%;*/
        /*margin-left: 19%;*/
    /*}*/
    @media(min-width: 1344px){
        nav{
            width: 86%;
            margin-left: 7%;
            /*margin-left: auto;*/
        }
    }
    @media(min-width: 1520px) and (max-width: 1920px){
        nav{
            width: 60%;
            margin-left: 20%;
        }



    @media screen and (min-width: 960px) and (max-width: 1199px) {
        nav{
            width: 84%;
            margin-left: 8%;
            margin-right: auto;
            /*margin-left: auto;*/
        }
    }
    @media (min-width: 992px)
        .container {
            width: 100%;
        }
    @media(max-width: 375px)  {
        nav{
            width: 92%;
            margin-left: 4%;
        }
    }
        @media(min-width: 412px) and  (max-width: 420px){
            nav{
                width: 92%;
                margin-left: 4%;
            }


</style>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <?php
    NavBar::begin([
        'brandLabel' => "<h1 style='color : white;margin-top: -9px;'>".'my home'."</h1>",
        'brandUrl' => Yii::$app->homeUrl,
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
            'style' => 'background-color: rgba(0,0,0,0.6);right: 14px;left: 15px;margin-top: 0%;border: 0px;margin-bottom: 0%;'
        ],
    ]);
    $menuItems = [
        ['label' => '首页', 'url' => ['/home/index']],
    ];
    if (Yii::$app->user->isGuest) {
        $menuItems[] = ['label' => '注册', 'url' => ['/home/index']];
        $menuItems[] = ['label' => '登录', 'url' => ['/home/index']];
    } else {
        $menuItems = [
            ['label' => '首页', 'url' => ['/home/index']],
            ['label' => '推荐', 'url' => ['/recommend/index']],
            ['label' => '分区', 'url' => ['/video/partition']],
            ['label' => '个人中心', 'url' => ['/user/index']]
        ];
        $menuItems[] = '<li>'
            . Html::beginForm(['/home/logout'], 'post')
            . Html::submitButton(
                '退出(' . Yii::$app->user->identity->username . ')',
                ['class' => 'btn btn-link logout']
            )
            . Html::endForm()
            . '</li>';
    }
    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items' => $menuItems,
    ]);
    NavBar::end();
    ?>

    <div class="container">
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= Alert::widget() ?>
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; My Company <?= date('Y') ?></p>

        <p class="pull-right"><?= Yii::powered() ?></p>
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
